<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    h2 {
      text-align: center;
    }
    table{
      height: 80px;
      /* 合并相邻边框 */
      border-collapse: collapse;
      margin: 0 auto;
      text-align: center;
    }
    th{
      padding: 5px 30px;
    }
    table,th,td{
      border: 1px solid black;
    }
  </style>
</head>
<body>
  <h2>订单确认</h2>
  <table>
    <tr>
      <th>商品名称</th>
      <th>商品价格</th>
      <th>商品数量</th>
      <th>总价</th>
      <th>收货地址</th>
    </tr>
    <tr>
      <td>小米手机</td>
      <td>1999</td>
      <td>10</td>
      <td>19990</td>
      <td>家</td>
    </tr>
  </table>
  <script>
    let str1 = prompt('请输入商品名称：')
    let num1 = prompt('请输入商品价格：')
    let num2 = prompt('请输入商品数量：')
    let str2 = prompt('请输入收货地址：')
    document.write(`
      <table>
        <tr>
          <th>商品名称</th>
          <th>商品价格</th>
          <th>商品数量</th>
          <th>总价</th>
          <th>收货地址</th>
        </tr>
        <tr>
          <td>${str1}</td>
          <td>${num1}</td>
          <td>${num2}</td>
          <td>${num1*num2}</td>
          <td>${str2}</td>
        </tr>
      </table>
    `)
  </script>
</body>
</html>